'''
Author: your name
Date: 2020-10-28 14:29:07
LastEditTime: 2020-10-28 14:41:26
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \python-study\博客学习\进阶\练习题.py
'''
def JudgeYearIsLeape(year):
    if year%4!=0:
        return False
    if year%100==0 and year%400!=0:
        return False
    return True

def CalacYearDay(year,month,day):
    days={"1":31,"3":31,"4":30,"5":31,"6":30,"7":31,"8":31,"9":30,"10":31,"11":30,"12":31}
    i=1
    sum=day
    while i<month:
        if i==2:
            if JudgeYearIsLeape(year):
                sum+=29
            else:
                sum+=28
        else:
            sum+=days[str(i)]
        i+=1
    print(sum)

if __name__=="__main__":
    CalacYearDay(2020,2,8)